package hn.cch.example.lts11.handler;


import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.http.MediaType;
import org.springframework.stereotype.Component;
import org.springframework.web.reactive.function.BodyInserters;
import org.springframework.web.reactive.function.server.ServerRequest;
import org.springframework.web.reactive.function.server.ServerResponse;
import reactor.core.publisher.Mono;


@Component
public class TestHandler {

    private final static Logger logger = LoggerFactory.getLogger(TestHandler.class);

    public Mono<ServerResponse> text1(ServerRequest request) {
        logger.info("test1");
        return ServerResponse.ok().contentType(MediaType.TEXT_PLAIN)
            .body(BodyInserters.fromValue("test1"));
    }

    public Mono<ServerResponse> text2(ServerRequest request) {
        logger.info("test2");
        return ServerResponse.ok().contentType(MediaType.TEXT_PLAIN)
            .body(BodyInserters.fromValue("test2"));
    }

    public Mono<ServerResponse> text3(ServerRequest request) {
        logger.info("test3");
        return ServerResponse.ok().contentType(MediaType.TEXT_PLAIN)
            .body(BodyInserters.fromValue("test3"));
    }


}
